import React from 'react';
import AvTimerOutlined from '@material-ui/icons/AvTimerOutlined';
import { NavView, get_mod, loc, NavListSub } from 'sui';
import { TaskView } from './task/view';
import { BackView } from './back/view';
import { TraceView } from './trace/view';

const model = (cfg) => {
    const fix = [
        {uid: "buy.task", view: TaskView, value: loc("l_535")},
        {uid: "buy.back", view: BackView, value: loc("l_575")},
        {uid: "buy.trace", view: TraceView, value: loc("l_884")},
    ];

    return get_mod(cfg, fix, "buy");
};

const Buy = ({ mod, sideopen, cfg }) => <NavView cfg={cfg} model={model(cfg)} mod={mod} sideopen={sideopen} name="buy"/>;

const NavBuy = (props) => <NavListSub icon={<AvTimerOutlined/>} sub={model(props.cfg)} {...props} scut={15}/>;

export {NavBuy, Buy};
